﻿<!--***********************************************************************************

   Extended WPF Toolkit

   Copyright (C) 2007-2013 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at http://xceed.com/wpf_toolkit

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  **********************************************************************************-->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:System;assembly=mscorlib"
                    xmlns:local="clr-namespace:Xceed.Wpf.DataGrid"
                    xmlns:conv="clr-namespace:Xceed.Wpf.DataGrid.Converters"
                    xmlns:markup="clr-namespace:Xceed.Wpf.DataGrid.Markup"
                    xmlns:views="clr-namespace:Xceed.Wpf.DataGrid.Views">

   <ResourceDictionary.MergedDictionaries>

      <!-- Include the view independant, color-scheme independant, theme resources -->
      <markup:DataGridThemeResourceDictionary Source="Resources/Windows7.Resources.xaml" />

      <!-- Include the view dependant, color-scheme independant, theme graphics -->
      <markup:DataGridThemeResourceDictionary Source="Resources/TableView.Windows7.Graphics.xaml" />

      <!-- Include the standard grid element templates -->
      <markup:DataGridThemeResourceDictionary Source="../Common/TableflowView.GridElementTemplates.xaml" />

      <!-- Control Styles used in the Grid Control -->
      <markup:DataGridThemeResourceDictionary Source="Resources/Windows7.Controls.xaml" />

   </ResourceDictionary.MergedDictionaries>

   <!-- =================================================================== -->
   <!-- Resources specific to this View/Theme/ColorScheme                   -->
   <!-- =================================================================== -->

   <Color x:Key="mainGradientColor">
      #C4DDFF
   </Color>

   <SolidColorBrush x:Key="rowSelectionBackgroundBrush"
                    Color="#FF3EBCF6" />

   <!--This brush is used for the columnManagerCell separator line-->
   <SolidColorBrush x:Key="darkBorderBrush"
                    Color="#FF04A2F7" />

   <!--This Brush is used for the grid lines color-->
   <SolidColorBrush x:Key="lightBackgroundBrush"
                    Color="#DDE0E3" />

   <!--This color is used for the border around groupByItem-->
   <SolidColorBrush x:Key="borderBrush"
                    Color="Black" />

   <SolidColorBrush x:Key="columnManagerRowBorderBrush"
                    Color="#6593CF" />

   <SolidColorBrush x:Key="warningBackgroundBrush"
                    Color="#FFC400" />

   <SolidColorBrush x:Key="warningForegroundBrush"
                    Color="Black" />

   <SolidColorBrush x:Key="headerForegroundBrush"
                    Color="Black" />

   <RadialGradientBrush x:Key="rowSelectorBrush"
                        RadiusX="1"
                        RadiusY="1"
                        GradientOrigin="0,0"
                        Center="0,0">
      <GradientStop Color="#FFD1ECFF"
                    Offset="1" />
      <GradientStop Color="#FF47C6F8"
                    Offset="0" />
   </RadialGradientBrush>

   <LinearGradientBrush x:Key="rowSelectorPressedBrush"
                        StartPoint="1,0.5"
                        EndPoint="0,0.5">
      <GradientStop Color="#FF04A2F7" />
      <GradientStop Offset="0.7" />
      <GradientStop Offset="0.15"
                    Color="#0004A2F7" />
   </LinearGradientBrush>

   <RadialGradientBrush x:Key="columnManagerCellRoundedEffectBrush"
                        Center="0.51,0.78"
                        GradientOrigin="0.51,1.17"
                        RadiusX="0.66"
                        RadiusY="0.66">
      <GradientStop Color="#BFFFFFFF"
                    Offset="0.14" />
      <GradientStop Offset="0.69"
                    Color="#331494DF" />
      <GradientStop Color="#4CFFFFFF"
                    Offset="0.28" />
      <GradientStop Color="#001494DF"
                    Offset="1" />
   </RadialGradientBrush>

   <LinearGradientBrush x:Key="columnManagerCellBlackLineBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="#00000000"
                    Offset="1" />
      <GradientStop Color="#00000000" />
      <GradientStop Color="Black"
                    Offset="0.5" />
   </LinearGradientBrush>

   <LinearGradientBrush  x:Key="columnManagerCellWhiteLineBrush"
                         EndPoint="0.99,0.95"
                         StartPoint="1,0.11">
      <GradientStop Color="#BFFFFFFF"
                    Offset="0.5" />
      <GradientStop Offset="1" />
      <GradientStop />
   </LinearGradientBrush>

   <RadialGradientBrush x:Key="columnManagerCellResizerDecoratorBrush"
                        RadiusX="0.997"
                        RadiusY="0.964"
                        GradientOrigin="-0.477,-0.055">
      <GradientStop Offset="0.71" />
      <GradientStop Color="White"
                    Offset="1" />
   </RadialGradientBrush>

   <LinearGradientBrush x:Key="columnManagerRowBackgroundBrush"
                        StartPoint="-0.01,1.33"
                        EndPoint="0.57,-10.76">
      <GradientStop Color="#FF18a6f7"
                    Offset="0" />
      <GradientStop Color="#FF47c0f6"
                    Offset="0.087" />
      <GradientStop Color="#FF31b6f7"
                    Offset="0.174" />
      <GradientStop Color="#FF47C0F6"
                    Offset="0.268" />
      <GradientStop Color="#FF23a5fa"
                    Offset="0.378" />
      <GradientStop Color="#FF1395f3"
                    Offset="0.486" />
      <GradientStop Color="#FF1694f9"
                    Offset="0.595" />
      <GradientStop Color="#FF2190f5"
                    Offset="0.85" />
      <GradientStop Color="#FF47C0F6"
                    Offset="0.718" />
      <GradientStop Color="#FF015EC8"
                    Offset="1" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="columnManagerRowWhiteBorderBrush"
                        EndPoint="1.33,1.31"
                        StartPoint="-0.59,-0.56">
      <GradientStop Color="#BFFFFFFF"
                    Offset="0.46" />
      <GradientStop Color="#33FFFFFF"
                    Offset="1.00" />
      <GradientStop Color="#33FFFFFF" />
   </LinearGradientBrush>

   <RadialGradientBrush x:Key="groupByControlBackgroundBrush"
                        Center="0.503,0.35"
                        GradientOrigin="1.1,0.504"
                        RadiusX="0.523"
                        RadiusY="2.375">
      <GradientStop Color="#FF04A2F7"
                    Offset="0.5" />
      <GradientStop Color="#FF015EC8"
                    Offset="0.25" />
      <GradientStop Color="#FF86E9F9"
                    Offset="0.682" />
      <GradientStop Color="#FF013C98"
                    Offset="0.003" />
      <GradientStop Color="#FFC9F4FB"
                    Offset="1" />
   </RadialGradientBrush>

   <LinearGradientBrush x:Key="groupByItemBackgroundBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="White"
                    Offset="0" />
      <GradientStop Offset="0.50"
                    Color="#7FFFFFFF" />
      <GradientStop Color="White"
                    Offset="1" />
   </LinearGradientBrush>

   <RadialGradientBrush x:Key="groupByItemMouseOverBackgroundBrush"
                        Center="0.507,0.779"
                        GradientOrigin="0.51,1.174"
                        RadiusX="0.664"
                        RadiusY="0.664">
      <GradientStop Color="White"
                    Offset="0.175" />
      <GradientStop Offset="0.776"
                    Color="#591494DF" />
      <GradientStop Color="#BFFFFFFF"
                    Offset="0.325" />
      <GradientStop Color="#4CFFFFFF"
                    Offset="1" />
      <GradientStop Color="#3FFFFFFF"
                    Offset="0.484" />
   </RadialGradientBrush>

   <LinearGradientBrush x:Key="groupByItemPressedBackgroundBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="White"
                    Offset="0" />
      <GradientStop Offset="0.528"
                    Color="#FF9ADAFF" />
      <GradientStop Color="White"
                    Offset="1" />
      <GradientStop Color="#FFC1E8FF"
                    Offset="0.244" />
      <GradientStop Color="#FFC7EAFF"
                    Offset="0.785" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="hierarchicalGroupByControlNodeBackgroundBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="#7FFFFFFF"
                    Offset="0" />
      <GradientStop Offset="0.53"
                    Color="#3FFFFFFF" />
      <GradientStop Color="#7FFFFFFF"
                    Offset="1" />
   </LinearGradientBrush>

   <SolidColorBrush x:Key="rowAlternatingBackgroundBrush"
                    Color="#FFD1ECFF" />

   <LinearGradientBrush x:Key="rowInactiveSelectionBackgroundBrush"
                        EndPoint="1,0.5"
                        StartPoint="0,0.5">
      <GradientStop Color="#FFD9D9D9"
                    Offset="0" />
      <GradientStop Color="#FF9A9A9A"
                    Offset="1" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="rowSplitterBackgroundBrush"
                        EndPoint="1,0.5"
                        StartPoint="0,0.5">
      <GradientStop Color="#BFFFFFFF"
                    Offset="0" />
      <GradientStop Color="#BFFFFFFF"
                    Offset="1" />
      <GradientStop Offset="0.5" />
   </LinearGradientBrush>

   <SolidColorBrush x:Key="currentCellBackgroundBrush"
                    Color="#7FFFFFFF" />

   <LinearGradientBrush x:Key="currentCellWhiteBorderBrush"
                        EndPoint="1.33,1.31"
                        StartPoint="-0.59,-0.56">
      <GradientStop Color="#BFFFFFFF"
                    Offset="0.46" />
      <GradientStop Color="#33FFFFFF"
                    Offset="1" />
      <GradientStop Color="#33FFFFFF" />
   </LinearGradientBrush>
   <LinearGradientBrush x:Key="currentCellBlackBorderBrush"
                        EndPoint="1.12,1.29"
                        StartPoint="-0.1,-0.17">
      <GradientStop Color="#26000000"
                    Offset="0.48" />
      <GradientStop Color="Black"
                    Offset="1" />
      <GradientStop Color="Black"
                    Offset="0.01" />
   </LinearGradientBrush>

   <SolidColorBrush x:Key="dataGridControlBackgroundBrush"
                    Color="#E5EFFF" />

   <Pen x:Key="groupByConnectionLinePen"
        Thickness="1"
        Pen.Brush="{StaticResource borderBrush}" />

   <Pen x:Key="dropMarkPen"
        Thickness="6"
        Brush="#FF9DDDF9" />

   <LinearGradientBrush x:Key="columnChooserBackgroundBrush"
                        EndPoint="0.979,0.046"
                        StartPoint="-0.019,1.017">
      <GradientStop Color="#FF1686D8"
                    Offset="1" />
      <GradientStop Color="#FF06397B"
                    Offset="0.297" />
   </LinearGradientBrush>

   <!-- =================================================================== -->
   <!-- Templates specific to this View/Theme/ColorScheme                   -->
   <!-- =================================================================== -->

   <!--**************************
    * TEMPLATE: GroupNavigationControl
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7GroupNavigationControlTemplate"
                    TargetType="{x:Type local:GroupNavigationControl}">

      <Grid>

         <Border x:Name="outlineBorder"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 CornerRadius="4">
            <Border x:Name="innerBorder"
                    BorderThickness="0,0,1,1"
                    CornerRadius="3">
               <Border.BorderBrush>
                  <RadialGradientBrush Center="1,3.5"
                                       GradientOrigin="1,0.5"
                                       RadiusX="2"
                                       RadiusY="3">
                     <GradientStop Color="Transparent"
                                   Offset="1" />
                     <GradientStop Color="#FF9A9A9A"
                                   Offset="0" />
                  </RadialGradientBrush>
               </Border.BorderBrush>
               <Grid>
                  <Grid.ColumnDefinitions>
                     <!-- Button part -->
                     <ColumnDefinition Width="*" />

                     <!-- Seperator part -->
                     <ColumnDefinition Width="Auto" />

                     <!-- Toggle button part -->
                     <ColumnDefinition Width="Auto" />
                  </Grid.ColumnDefinitions>

                  <Button x:Name="PART_Button"
                          Command="local:GroupNavigationButton.NavigateToGroup"
                          CommandParameter="{TemplateBinding Group}"
                          Content="{TemplateBinding Group}"
                          ContentTemplate="{TemplateBinding MainItemTemplate}"
                          ContentTemplateSelector="{TemplateBinding MainItemTemplateSelector}"
                          Foreground="{TemplateBinding Foreground}"
                          Focusable="False"
                          Grid.Column="0">
                     <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                           <Border Background="Transparent">
                              <ContentPresenter Margin="4,2,4,2" />
                           </Border>
                        </ControlTemplate>
                     </Button.Template>
                  </Button>

                  <Border x:Name="seperator"
                          Grid.Column="1"
                          BorderThickness="0,0,1,0">
                     <Border.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="-2.419,-0.028">
                           <GradientStop Offset="0.1" />
                           <GradientStop Offset="0.9" />
                           <GradientStop Color="White"
                                         Offset="0.5" />
                        </LinearGradientBrush>
                     </Border.BorderBrush>
                     <Border BorderThickness="0,0,1,0">
                        <Border.BorderBrush>
                           <LinearGradientBrush EndPoint="0.5,1"
                                                StartPoint="-2.419,-0.028">
                              <GradientStop Color="#00000000"
                                            Offset="0.1" />
                              <GradientStop Color="#00000000"
                                            Offset="0.9" />
                              <GradientStop Color="Black"
                                            Offset="0.5" />
                           </LinearGradientBrush>
                        </Border.BorderBrush>
                     </Border>
                  </Border>

                  <ToggleButton x:Name="PART_ToggleButton"
                                Focusable="False"
                                IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                Grid.Column="2">
                     <ToggleButton.Template>
                        <ControlTemplate>
                           <Border x:Name="toggleButtonBackground"
                                   CornerRadius="0,2,2,0"
                                   Background="Transparent">
                              <Path x:Name="Arrow"
                                    Fill="Black"
                                    Margin="7,1,7,1"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Data="M 0 0 L 4 4 L 0 8 Z" />
                           </Border>

                           <ControlTemplate.Triggers>
                              <Trigger Property="ToggleButton.IsChecked"
                                       Value="True">
                                 <Setter TargetName="Arrow"
                                         Property="Margin"
                                         Value="5,1,5,1" />
                                 <Setter TargetName="Arrow"
                                         Property="Data"
                                         Value="M 0 0 L 4 4 L 8 0 Z" />
                              </Trigger>
                           </ControlTemplate.Triggers>
                        </ControlTemplate>
                     </ToggleButton.Template>
                  </ToggleButton>
               </Grid>
            </Border>
         </Border>

         <Popup x:Name="PART_Popup"
                Placement="Bottom"
                IsOpen="{TemplateBinding IsDropDownOpen}"
                AllowsTransparency="True"
                Focusable="False"
                PopupAnimation="Slide">
            <Grid SnapsToDevicePixels="True"
                  MinWidth="{TemplateBinding ActualWidth}"
                  MaxHeight="{TemplateBinding MaxDropDownHeight}">
               <Border CornerRadius="5"
                       BorderThickness="1"
                       BorderBrush="{StaticResource basicBlackBorderBrush}"
                       TextElement.Foreground="White"
                       Background="{StaticResource columnChooserBackgroundBrush}">
                  <Border BorderThickness="1"
                          CornerRadius="5"
                          BorderBrush="{StaticResource basicWhiteBorderBrush}">

                     <ScrollViewer CanContentScroll="True"
                                   HorizontalScrollBarVisibility="Disabled"
                                   VerticalScrollBarVisibility="Auto"
                                   Margin="4">
                        <!--<ItemsPresenter />-->
                        <VirtualizingStackPanel IsItemsHost="True"
                                                Margin="0,0,4,0" />
                     </ScrollViewer>
                  </Border>
               </Border>
            </Grid>
         </Popup>
      </Grid>

      <ControlTemplate.Triggers>
         <Trigger Property="IsMouseOver"
                  Value="True">
            <Setter TargetName="innerBorder"
                    Property="Background">
               <Setter.Value>
                  <LinearGradientBrush EndPoint="0.5,1"
                                       StartPoint="0.5,0">
                     <GradientStop Color="#BF1494DF"
                                   Offset="1" />
                     <GradientStop Offset="0.5" />
                  </LinearGradientBrush>
               </Setter.Value>
            </Setter>

            <Setter TargetName="innerBorder"
                    Property="BorderBrush">
               <Setter.Value>
                  <LinearGradientBrush EndPoint="0.5,1"
                                       StartPoint="0.5,0">
                     <GradientStop Color="#FFC0C0C0"
                                   Offset="1" />
                     <GradientStop Color="#FFC0C0C0"
                                   Offset="0.5" />
                     <GradientStop Color="#00C0C0C0"
                                   Offset="0.49" />
                  </LinearGradientBrush>
               </Setter.Value>
            </Setter>
         </Trigger>

         <Trigger Property="IsDropDownOpen"
                  Value="True">
            <Setter TargetName="seperator"
                    Property="Visibility"
                    Value="Visible" />
         </Trigger>
      </ControlTemplate.Triggers>
   </ControlTemplate>

   <!--**************************
    * TEMPLATE: GroupNavigationButton
    ************************** -->
   <ControlTemplate x:Key="tableflowViewGroupNavigationButtonTemplate"
                    TargetType="{x:Type local:GroupNavigationButton}">
      <Grid>
         <Border x:Name="mainBorder"
                 Background="Transparent"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 CornerRadius="4">
            <Border x:Name="innerBorder"
                    BorderThickness="0,0,1,1"
                    CornerRadius="3">
               <Border.BorderBrush>
                  <RadialGradientBrush Center="1,3.5"
                                       GradientOrigin="1,0.5"
                                       RadiusX="2"
                                       RadiusY="3">
                     <GradientStop Color="Transparent"
                                   Offset="1" />
                     <GradientStop Color="#FF9A9A9A"
                                   Offset="0" />
                  </RadialGradientBrush>
               </Border.BorderBrush>

               <ContentPresenter HorizontalAlignment="Center"
                                 Margin="3"
                                 VerticalAlignment="Center"
                                 TextElement.Foreground="{TemplateBinding Foreground}" />
            </Border>
         </Border>
      </Grid>
   </ControlTemplate>

   <!--**************************
    * TEMPLATE: ColumnManagerCell 
    ************************** -->
   <conv:SortingDirectionToBooleanConverter x:Key="SortingDirectionToBooleanConverter" />

   <ControlTemplate x:Key="tableflowViewWindows7ColumnManagerCellTemplate"
                    TargetType="local:ColumnManagerCell">

      <!-- We don't use the base Cell Template for the ColumnManagerCell because it need more elements
           to function properly: a Thumb named "PART_ColumnResizerThumb" that is used to resize the
           ColumnManagerCells's ParentColumn.Width and a glyph that represents the Column's SortDirection. -->
      <Grid x:Name="Grid"
            Background="Transparent">

         <Grid x:Name="ColumnResizerDecorator">
            <Path Stretch="Fill"
                  HorizontalAlignment="Right"
                  Height="28"
                  Width="20"
                  Fill="{StaticResource columnManagerCellResizerDecoratorBrush}"
                  Data="M0,28 z L18,28 C19,27 19,27 20,26 L20,2 L18.5,14 C17,25 17,25 0,28 Z" />

            <Grid Height="12"
                  Width="3"
                  HorizontalAlignment="Right"
                  Margin="0,0,3,0">
               <Grid.Resources>
                  <DataTemplate x:Key="ResizerDot">
                     <Grid>
                        <Border Width="2"
                                Height="2"
                                BorderBrush="#55000000"
                                BorderThickness="1"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Left" />
                        <Border Width="1"
                                Height="1"
                                BorderBrush="#55FFFFFF"
                                BorderThickness="1"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Left" />
                     </Grid>
                  </DataTemplate>
               </Grid.Resources>

               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
               </Grid.ColumnDefinitions>
               <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="*" />
                  <RowDefinition Height="*" />
               </Grid.RowDefinitions>

               <ContentPresenter ContentTemplate="{StaticResource ResizerDot}"
                                 Grid.Row="0"
                                 Margin="1,1,0,1" />
               <ContentPresenter ContentTemplate="{StaticResource ResizerDot}"
                                 Grid.Row="1"
                                 Margin="1,1,0,1" />
               <ContentPresenter ContentTemplate="{StaticResource ResizerDot}"
                                 Grid.Row="2"
                                 Margin="1,1,0,1" />
            </Grid>
         </Grid>

         <Border x:Name="PressEffect"
                 Opacity="0"
                 CornerRadius="5"
                 Background="{StaticResource columnManagerCellRoundedEffectBrush}" />

         <Border x:Name="BlackLine"
                 BorderThickness="1,0"
                 Opacity="0"
                 CornerRadius="5"
                 BorderBrush="{StaticResource columnManagerCellBlackLineBrush}">
            <Border x:Name="WhiteLine"
                    BorderThickness="1,0"
                    Opacity="0"
                    CornerRadius="4"
                    BorderBrush="{StaticResource columnManagerCellWhiteLineBrush}" />
         </Border>

         <Grid>
            <Border x:Name="mainBorder"
                    Background="Transparent"
                    Padding="{TemplateBinding Padding}">

               <DockPanel Margin="0,0,4,0">

                  <Grid x:Name="toggleGrid"
                        DockPanel.Dock="Right"
                        Visibility="Collapsed"
                        Margin="0,5,4,0">

                     <ToggleButton x:Name="toggleButton"
                                   Focusable="False"
                                   VerticalAlignment="Stretch"
                                   Margin="2,0,0,0"
                                   Opacity="0.5" />
                  </Grid>

                  <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}">

                     <Grid.RowDefinitions>
                        <RowDefinition Height="6" />
                        <RowDefinition Height="Auto" />
                     </Grid.RowDefinitions>

                     <!-- ContentPresenter that is used to display the sort glyph.
                        We explicitely set its Content property to Null to prevent the XAML parser
                        from implicitely setting it to its TemplatedParent's Content. -->
                     <StackPanel Orientation="Horizontal"
                                 Grid.Row="0"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center">
                        <ContentPresenter x:Name="sortGlyphPresenter"
                                          Content="{x:Null}"
                                          ContentTemplate="{x:Null}"
                                          TextElement.Foreground="#FFFFFFFF" />
                     </StackPanel>

                     <!-- Same ContentPresenter as in the base Cell Template. -->
                     <local:CellContentPresenter VerticalAlignment="Center"
                                                 HorizontalAlignment="Center"
                                                 Grid.Row="1" />

                  </Grid>
               </DockPanel>
            </Border>

            <!-- Thumb that is used to resize the Column. -->
            <Thumb x:Name="PART_ColumnResizerThumbLeft"
                   Style="{StaticResource invisibleThumbStyle}"
                   Width="6"
                   HorizontalAlignment="Left" />

            <!-- Thumb that is used to resize the Column. -->
            <Thumb x:Name="PART_ColumnResizerThumb"
                   Style="{StaticResource invisibleThumbStyle}"
                   Width="6"
                   HorizontalAlignment="Right" />
         </Grid>
      </Grid>

      <ControlTemplate.Triggers>

         <!-- Trigger related to the filteringToggleButton-->
         <Trigger SourceName="toggleButton"
                  Property="IsMouseOver"
                  Value="True">

            <Setter TargetName="toggleButton"
                    Property="Opacity"
                    Value="1" />
         </Trigger>

         <!-- The following 2 triggers allow to display the appropriate Sort Glyph
              depending on the ParentColumn's SortDirection. -->

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}"
                      Value="Ascending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" />

         </DataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}"
                      Value="Descending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" />

         </DataTrigger>

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.HasFixedWidth}"
                          Value="True" />

               <!-- Don't disable resizing if ColumnStretching can be disabled by an 
                    end-user resize. -->
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).RemoveColumnStretchingOnResize}"
                          Value="False" />
            </MultiDataTrigger.Conditions>

            <Setter TargetName="PART_ColumnResizerThumb"
                    Property="IsEnabled"
                    Value="False" />
         </MultiDataTrigger>

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.PreviousVisibleColumn.HasFixedWidth}"
                          Value="True" />

               <!-- Don't disable resizing if ColumnStretching can be disabled by an 
                    end-user resize. -->
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).RemoveColumnStretchingOnResize}"
                          Value="False" />
            </MultiDataTrigger.Conditions>

            <Setter TargetName="PART_ColumnResizerThumbLeft"
                    Property="IsEnabled"
                    Value="False" />
         </MultiDataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentRow.AllowColumnResize}"
                      Value="False">
            <Setter TargetName="PART_ColumnResizerThumb"
                    Property="IsEnabled"
                    Value="False" />
            <Setter TargetName="PART_ColumnResizerThumbLeft"
                    Property="IsEnabled"
                    Value="False" />
         </DataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.Visible}"
                      Value="False">

            <Setter Property="Visibility"
                    Value="Collapsed" />

         </DataTrigger>

         <!-- Trigger to set the background and pressed effect depending on state -->
         <Trigger Property="IsMouseOver"
                  Value="true">
            <Trigger.EnterActions>
               <BeginStoryboard>
                  <Storyboard>
                     <DoubleAnimation BeginTime="00:00:00"
                                      Duration="00:00:00.2"
                                      Storyboard.TargetName="PressEffect"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1" />
                  </Storyboard>
               </BeginStoryboard>
            </Trigger.EnterActions>
            <Trigger.ExitActions>
               <BeginStoryboard>
                  <Storyboard>
                     <DoubleAnimation BeginTime="00:00:00"
                                      Duration="00:00:00.5"
                                      Storyboard.TargetName="PressEffect"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0" />
                  </Storyboard>
               </BeginStoryboard>
            </Trigger.ExitActions>
         </Trigger>

         <Trigger Property="IsPressed"
                  Value="true">
            <Trigger.EnterActions>
               <BeginStoryboard>
                  <Storyboard>
                     <DoubleAnimation BeginTime="00:00:00"
                                      Duration="00:00:00.02"
                                      Storyboard.TargetName="PressEffect"
                                      Storyboard.TargetProperty="Background.(RadialGradientBrush.RadiusY)"
                                      To="1.44" />
                  </Storyboard>
               </BeginStoryboard>
            </Trigger.EnterActions>
            <Trigger.ExitActions>
               <BeginStoryboard>
                  <Storyboard>
                     <DoubleAnimation BeginTime="00:00:00"
                                      Duration="00:00:00.7"
                                      Storyboard.TargetName="PressEffect"
                                      Storyboard.TargetProperty="Background.(RadialGradientBrush.RadiusY)"
                                      To="0.66" />
                  </Storyboard>
               </BeginStoryboard>
            </Trigger.ExitActions>
         </Trigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: RowSelector
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7RowSelectorTemplate"
                    TargetType="local:RowSelector">

      <!-- This Grid is used to position the resizer Thumb over the RowSelector -->
      <Grid>

         <Border x:Name="mainBorder"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}"
                 CornerRadius="3"
                 Margin="0,0,0,1">

            <ContentPresenter x:Name="contentPresenter"
                              Content="{TemplateBinding Content}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
         </Border>

         <!-- Thumb that is used to resize the Row. -->
         <Thumb x:Name="PART_RowResizerThumb"
                Style="{StaticResource invisibleThumbStyle}"
                VerticalAlignment="Bottom" />

         <Border x:Name="separatorLine"
                 Height="1"
                 Background="{StaticResource darkBorderBrush}"
                 VerticalAlignment="Bottom"
                 Margin="4,0,4,0" />

      </Grid>

      <ControlTemplate.Triggers>

         <Trigger Property="IsMouseOver"
                  Value="true">
            <Setter TargetName="mainBorder"
                    Property="Background">
               <Setter.Value>
                  <LinearGradientBrush EndPoint="-0.413,0.593"
                                       StartPoint="0.996,0.588">
                     <GradientStop Color="White"
                                   Offset="0" />
                     <GradientStop Offset="0.15" />
                     <GradientStop Offset="0.7" />
                     <GradientStop Color="White" />
                  </LinearGradientBrush>
               </Setter.Value>
            </Setter>

            <Setter TargetName="mainBorder"
                    Property="BorderBrush"
                    Value="{StaticResource darkBorderBrush}" />
         </Trigger>

         <Trigger Property="IsPressed"
                  Value="True">

            <Setter TargetName="mainBorder"
                    Property="Background"
                    Value="{StaticResource rowSelectorPressedBrush}" />

            <Setter TargetName="mainBorder"
                    Property="BorderBrush"
                    Value="{StaticResource darkBorderBrush}" />

         </Trigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: Row 
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7RowTemplate"
                    TargetType="local:Row">

      <!-- A basic Row Template requires at least a Panel named "PART_CellsHost" to which the Row's cells will be added.
           This Panel is usually placed inside a Border who is responsible for painting the gridlines. -->
      <ControlTemplate.Resources>
         <conv:TypeToBooleanConverter x:Key="typeToBooleanConverter" />
      </ControlTemplate.Resources>

      <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the CellsHost panel. -->
      <Grid x:Name="rootGrid">
         <Grid.ColumnDefinitions>
            <!-- HierarchicalGroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />
            <!-- GroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />
            <!-- MasterDetail ToggleButton -->
            <ColumnDefinition Width="Auto" />

            <!-- CellsHost panel -->
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>

         <!-- The border responsible for the visual outline of the row (gridlines and background)
                       spans the GroupLevelIndicatorPane and CellsHost Panel. Those 2 elements are not children of
                       the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
         <Border x:Name="rootBorder"
                 Grid.Column="2"
                 Grid.ColumnSpan="2"
                 views:TableView.CanScrollHorizontally="False"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}" />

         <local:HierarchicalGroupLevelIndicatorPane Grid.Column="0"
                                                    views:TableView.CanScrollHorizontally="False" />

         <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
                       whenever this Row is part of a group. -->
         <local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
                                        views:TableView.CanScrollHorizontally="False"
                                        Grid.Column="1" />

         <!-- ToggleButton that is used to expand/collapse the group. -->
         <Button x:Name="detailsToggle"
                 Template="{StaticResource detailsExpanderButtonTemplate}"
                 VerticalAlignment="Top"
                 Grid.Column="2"
                 Margin="2,4,2,0"
                 Command="{x:Static local:DataGridCommands.ToggleDetailExpansion}"
                 OverridesDefaultStyle="True"
                 Focusable="False"
                 Visibility="Collapsed"
                 views:TableView.CanScrollHorizontally="False" />

         <!-- This TextBlock is used to ensure that the DesiredSize for 
         the Row will never fall below the Height of a String using the inherited font size and face-->
         <TextBlock Text=""
                    Visibility="Hidden"
                    Grid.Column="3"
                    Margin="{TemplateBinding BorderThickness}" />

         <!-- The PART_CellsHost part designates the Panel to which this Row's Cells should be added.-->
         <views:FixedCellPanel x:Name="PART_CellsHost"
                               Grid.Column="3"
                               ColumnStretchMinWidth="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMinWidth}"
                               ColumnStretchMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMode}"
                               FixedCellCount="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnCount, Mode=TwoWay}"
                               FixedColumnDropMarkPen="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnDropMarkPen}"
                               Margin="{TemplateBinding BorderThickness}" />
      </Grid>

      <ControlTemplate.Triggers>

         <!-- When changing the appearance (e.g. background/foreground) of the Row to reflect specific
              states (e.g. IsSelected), it is recommended to apply the changes directly to the template
              elements because we want those modifications to be effective even when a value has been
              explicitely set to these properties on the TemplatedParent. Also, when someone queries
              the value of these properties on the TemplatedParent, we don't want to return the
              intermediate, state-specific values. -->

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.SelectionUnit}"
                          Value="Row" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background">
               <Setter.Value>
                  <RadialGradientBrush Center="0.503,0.35"
                                       GradientOrigin="1.009,0.295"
                                       RadiusX="0.636"
                                       RadiusY="2.375">
                     <GradientStop Color="#FF04A2F7" />
                     <GradientStop Color="#FF86E9F9"
                                   Offset="1" />
                     <GradientStop Color="#FF86E9F9"
                                   Offset="0.5" />
                  </RadialGradientBrush>
               </Setter.Value>
            </Setter>
         </MultiDataTrigger>

         <!-- When the Row is Selected, we want to change its background/foreground to the appropriate brushes. -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.IsKeyboardFocusWithin}"
                          Value="True" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionBackground}" />

            <Setter TargetName="rootGrid"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionForeground}" />

         </MultiDataTrigger>

         <!-- When the Row is Selected but the parent DataGridControl is not focused, we want to change
              the Row's background/foreground to the appropriate brushes. -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.IsKeyboardFocusWithin}"
                          Value="False" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.HideSelection}"
                          Value="False" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionBackground}" />

            <Setter TargetName="rootGrid"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionForeground}" />

         </MultiDataTrigger>

         <!-- When there are details, display the Toggle button for the expansion, collapsing of the details -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
                          Value="True" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
                          Value="True" />
               <Condition Value="True"
                          Binding="{Binding RelativeSource={RelativeSource Self}, Path=., Mode=OneWay, Converter={StaticResource typeToBooleanConverter}, ConverterParameter={x:Type local:DataRow}}" />
            </MultiDataTrigger.Conditions>

            <Setter TargetName="detailsToggle"
                    Property="Visibility"
                    Value="Visible" />

         </MultiDataTrigger>

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
                          Value="True" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
                          Value="True" />
               <Condition Value="False"
                          Binding="{Binding RelativeSource={RelativeSource Self}, Path=., Mode=OneWay, Converter={StaticResource typeToBooleanConverter}, ConverterParameter={x:Type local:DataRow}}" />
            </MultiDataTrigger.Conditions>

            <Setter TargetName="detailsToggle"
                    Property="Visibility"
                    Value="Hidden" />

         </MultiDataTrigger>
      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: GroupByControl
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7GroupByControlTemplate"
                    TargetType="local:GroupByControl">
      <Grid x:Name="mainGrid"
            Margin="0">

         <Border Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}" />

         <!-- Curly leaves pattern and bubbles -->
         <Border VerticalAlignment="Stretch"
                 HorizontalAlignment="Stretch">
            <Border.Background>
               <VisualBrush AlignmentX="Left"
                            Stretch="Uniform">
                  <VisualBrush.Visual>
                     <ContentPresenter ContentTemplate="{StaticResource CurvyLeavesPattern}"
                                       VerticalAlignment="Stretch"
                                       HorizontalAlignment="Stretch" />
                  </VisualBrush.Visual>
               </VisualBrush>
            </Border.Background>
         </Border>

         <Grid>
            <ContentControl x:Name="bubble1"
                            VerticalAlignment="Top"
                            HorizontalAlignment="Left"
                            Height="40"
                            Width="40"
                            Focusable="False"
                            SnapsToDevicePixels="False"
                            RenderTransformOrigin="0.5,0.5"
                            Template="{StaticResource groupByControlBubbleTemplate}">
               <ContentControl.RenderTransform>
                  <TranslateTransform X="-40" />
               </ContentControl.RenderTransform>
            </ContentControl>
            <ContentControl x:Name="bubble2"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Width="25"
                            Height="25"
                            Focusable="False"
                            SnapsToDevicePixels="False"
                            RenderTransformOrigin="0.5,0.5"
                            Template="{StaticResource groupByControlBubbleTemplate}">
               <ContentControl.RenderTransform>
                  <TranslateTransform X="-25" />
               </ContentControl.RenderTransform>
            </ContentControl>
            <ContentControl x:Name="bubble3"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Width="15"
                            Height="15"
                            Focusable="False"
                            SnapsToDevicePixels="False"
                            RenderTransformOrigin="0.5,0.5"
                            Template="{StaticResource groupByControlBubbleTemplate}">
               <ContentControl.RenderTransform>
                  <TranslateTransform X="-15" />
               </ContentControl.RenderTransform>
            </ContentControl>
         </Grid>

         <!-- This Grid is used to position the ItemsPresenter over the ContentPresenter in charge
              of displaying the NoGroupContent. -->
         <Grid Margin="{TemplateBinding Padding}">

            <!-- This ContentPresenter displays the value of the NoGroupContent property
                 of the GroupByControl. This content must only be displayed when there are
                 no groups present, so we set its Visibility to Collapsed by default and
                 it is made visible via a trigger. -->
            <ContentPresenter x:Name="noGroupContentPresenter"
                              Content="{TemplateBinding NoGroupContent}"
                              VerticalAlignment="Center"
                              Visibility="Collapsed"
                              IsHitTestVisible="False" />

            <!-- The GroupByControl is an ItemsControl, so it must have an ItemsPresenter in its
                 Template in order to layout and show its child items. The default ItemsPanel
                 of the GroupByControl is a "StaircasePanel", which layout its items in a
                 staircase-like pattern and draws connecting lines between the items. -->
            <ItemsPresenter />

         </Grid>
      </Grid>

      <ControlTemplate.Triggers>

         <!-- When there are no groups, make the NoGroupContent visible. -->
         <Trigger Property="HasItems"
                  Value="False">

            <Setter TargetName="noGroupContentPresenter"
                    Property="Visibility"
                    Value="Visible" />
         </Trigger>

         <!-- Bubbles Animation -->
         <EventTrigger SourceName="mainGrid"
                       RoutedEvent="Grid.Loaded">
            <EventTrigger.Actions>
               <BeginStoryboard>
                  <Storyboard Duration="00:10:00"
                              RepeatBehavior="Forever"
                              Timeline.DesiredFrameRate="20">
                     <DoubleAnimationUsingPath BeginTime="00:00:00"
                                               Duration="00:05:00"
                                               Storyboard.TargetName="bubble1"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                                               Source="X">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-31,11 C-31,11 82.462368,65.802014 130.5,49.5 178.53763,33.197986 204.06968,7.4634866 267.5,6.5 334.55253,5.4814933 418.45061,50.4996 481.5,50.5 537.08628,50.500353 649.57165,18.872376 721.5,14.5 855.60506,6.3480301 970.42944,34.5 1060.5,34.5 1120.0867,34.5 1256.5,-19.5 1256.5,-19.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimationUsingPath BeginTime="00:00:00"
                                               Duration="00:05:00"
                                               Storyboard.TargetName="bubble1"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
                                               Source="Y">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-31,11 C-31,11 82.462368,65.802014 130.5,49.5 178.53763,33.197986 204.06968,7.4634866 267.5,6.5 334.55253,5.4814933 418.45061,50.4996 481.5,50.5 537.08628,50.500353 649.57165,18.872376 721.5,14.5 855.60506,6.3480301 970.42944,34.5 1060.5,34.5 1120.0867,34.5 1256.5,-19.5 1256.5,-19.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimation BeginTime="00:04:00"
                                      Duration="00:01:00"
                                      Storyboard.TargetName="bubble1"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      From="1"
                                      To="0" />
                     <DoubleAnimationUsingPath BeginTime="00:01:00"
                                               Duration="00:04:00"
                                               Storyboard.TargetName="bubble2"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                                               Source="X">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-14.5,51.5 C-14.5,51.5 166.5,8.5 218.5,42.5 270.5,76.5 323.29493,96.682289 372.29493,84.682289 421.29493,72.682289 496.29493,22.682289 537.29493,27.682289 578.29493,32.682289 641.5,55.5 677.5,58.5 713.5,61.5 757.5,36.5 789.5,27.5 821.5,18.5 882.5,44.5 928.5,56.5 974.5,68.5 1042.5,49.5 1074.5,33.5 1106.5,17.5 1161.5,25.5&#xd;&#xa;1185.5,43.5 1209.5,61.5 1271.5,45.5 1271.5,45.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimationUsingPath BeginTime="00:01:00"
                                               Duration="00:04:00"
                                               Storyboard.TargetName="bubble2"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
                                               Source="Y">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-14.5,51.5 C-14.5,51.5 166.5,8.5 218.5,42.5 270.5,76.5 323.29493,96.682289 372.29493,84.682289 421.29493,72.682289 496.29493,22.682289 537.29493,27.682289 578.29493,32.682289 641.5,55.5 677.5,58.5 713.5,61.5 757.5,36.5 789.5,27.5 821.5,18.5 882.5,44.5 928.5,56.5 974.5,68.5 1042.5,49.5 1074.5,33.5 1106.5,17.5 1161.5,25.5&#xd;&#xa;1185.5,43.5 1209.5,61.5 1271.5,45.5 1271.5,45.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimation BeginTime="00:04:00"
                                      Duration="00:01:00"
                                      Storyboard.TargetName="bubble2"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      From="1"
                                      To="0" />
                     <DoubleAnimationUsingPath BeginTime="00:00:24"
                                               Duration="00:04:12"
                                               Storyboard.TargetName="bubble3"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                                               Source="X">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-14.5,36.5 C-14.5,36.5 69.5,-4.4998449 121.5,29.500155 173.5,63.500155 250.5,72.500155 299.5,60.500155 348.5,48.500155 418.5,7.5001551 459.5,12.500155 500.5,17.500155 549.32936,71.672597 585.32936,74.672597 621.32936,77.672597 696.5,38.5 728.5,29.5 760.5,20.5 876.5,42.5 922.5,54.5 968.5,66.5 1031.5,35.5 1063.5,19.5 1095.5,3.5 1142.5,41.5&#xd;&#xa;1175.5,42.5 1205.4862,43.408674 1283.5,15.5 1283.5,15.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimationUsingPath BeginTime="00:00:24"
                                               Duration="00:04:12"
                                               Storyboard.TargetName="bubble3"
                                               Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
                                               Source="Y">
                        <DoubleAnimationUsingPath.PathGeometry>
                           <PathGeometry Figures="M-14.5,36.5 C-14.5,36.5 69.5,-4.4998449 121.5,29.500155 173.5,63.500155 250.5,72.500155 299.5,60.500155 348.5,48.500155 418.5,7.5001551 459.5,12.500155 500.5,17.500155 549.32936,71.672597 585.32936,74.672597 621.32936,77.672597 696.5,38.5 728.5,29.5 760.5,20.5 876.5,42.5 922.5,54.5 968.5,66.5 1031.5,35.5 1063.5,19.5 1095.5,3.5 1142.5,41.5&#xd;&#xa;1175.5,42.5 1205.4862,43.408674 1283.5,15.5 1283.5,15.5" />
                        </DoubleAnimationUsingPath.PathGeometry>
                     </DoubleAnimationUsingPath>
                     <DoubleAnimation BeginTime="00:03:36"
                                      Duration="00:01:00"
                                      Storyboard.TargetName="bubble3"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      From="1"
                                      To="0" />
                  </Storyboard>
               </BeginStoryboard>
            </EventTrigger.Actions>
         </EventTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: GroupByItem
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7GroupByItemTemplate"
                    TargetType="local:GroupByItem">

      <Grid>

         <Border x:Name="mouseOverEffect"
                 Opacity="0"
                 CornerRadius="5"
                 Background="{StaticResource groupByItemMouseOverBackgroundBrush}" />

         <Border x:Name="mainBorder"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}"
                 CornerRadius="5">

            <!-- This StackPanel is used to layout the ContentPresenter and the Sort Glyph (when present). -->
            <StackPanel Orientation="Horizontal">

               <!-- Same ContentPresenter as in the base Cell Template. -->
               <ContentPresenter Content="{TemplateBinding Content}"
                                 ContentTemplate="{TemplateBinding ContentTemplate}"
                                 ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 Margin="0,4" />

               <!-- ContentPresenter that is used to display the sort glyph.
                 We explicitely set its Content property to Null to prevent the XAML parser
                 from implicitely setting it to its TemplatedParent's Content. -->
               <ContentPresenter x:Name="sortGlyphPresenter"
                                 Content="{x:Null}"
                                 ContentTemplate="{x:Null}"
                                 Margin="15,0,0,0"
                                 TextBlock.Foreground="Black" />

            </StackPanel>
         </Border>

         <Border x:Name="blackBorder"
                 BorderThickness="1"
                 BorderBrush="{StaticResource basicBlackBorderBrush}"
                 CornerRadius="5">
            <Border x:Name="whiteBorder"
                    BorderThickness="1"
                    BorderBrush="{StaticResource basicWhiteBorderBrush}"
                    CornerRadius="4" />
         </Border>

      </Grid>

      <ControlTemplate.Triggers>

         <Trigger Property="IsMouseOver"
                  Value="true">
            <Setter TargetName="mouseOverEffect"
                    Property="Opacity"
                    Value="1" />
         </Trigger>

         <Trigger Property="IsPressed"
                  Value="true">
            <Setter TargetName="mainBorder"
                    Property="Background"
                    Value="{StaticResource groupByItemPressedBackgroundBrush}" />
         </Trigger>

         <!-- The following 2 triggers allow to display the appropriate Sort Glyph
              depending on the ParentColumn's SortDirection. -->
         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
                      Value="Ascending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" />

            <Setter TargetName="sortGlyphPresenter"
                    Property="Margin"
                    Value="6,0,0,0" />

         </DataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
                      Value="Descending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" />

            <Setter TargetName="sortGlyphPresenter"
                    Property="Margin"
                    Value="6,0,0,0" />

         </DataTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: GroupHeaderControl
    ************************** -->
   <conv:IntAdditionConverter x:Key="groupHeaderControlGroupLevelConverter" />
   <ControlTemplate x:Key="tableflowViewWindows7GroupHeaderControlTemplate"
                    TargetType="local:GroupHeaderControl">

      <!-- Using this decorator will prevent the GroupHeaderControl of exceeding the width 
           defined by the grid's column. -->
      <views:PassiveLayoutDecorator Axis="Horizontal">
         <DockPanel>

            <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
              whenever this GroupHeaderControl is part of a group. -->
            <local:HierarchicalGroupLevelIndicatorPane DockPanel.Dock="Left" />
            <local:GroupLevelIndicatorPane DockPanel.Dock="Left"
                                           Indented="False"
                                           local:GroupLevelIndicatorPane.GroupLevel="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel), Converter={StaticResource groupHeaderControlGroupLevelConverter}, ConverterParameter=-1}" />
            <!-- Main Border for the GroupHeaderControl. It is Focusable to make the InputBindings work. -->
            <Border x:Name="mainBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="{TemplateBinding Padding}"
                    Focusable="True"
                    FocusVisualStyle="{TemplateBinding FocusVisualStyle}">

               <!-- Define all the standard InputBindings for a GroupHeaderControl. -->
               <Border.InputBindings>
                  <KeyBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
                              Key="Space" />

                  <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
                              Key="Right" />

                  <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
                              Key="Add" />

                  <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
                              Key="Left" />

                  <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
                              Key="Subtract" />

                  <MouseBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
                                MouseAction="LeftDoubleClick" />

               </Border.InputBindings>

               <DockPanel>

                  <!-- ToggleButton that is used to expand/collapse the group. -->
                  <ToggleButton DockPanel.Dock="Left"
                                OverridesDefaultStyle="True"
                                Template="{StaticResource groupExpanderToggleButtonTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Focusable="False"
                                IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Group.IsExpanded}" />

                  <!-- ContentPresenter in charge of displaying this GroupHeaderControl's Content, which is
                    a Group by default. -->
                  <ContentPresenter DockPanel.Dock="Left"
                                    Margin="3,0,0,0"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

                  <!-- Line that is traced across the GroupHeader, following the content -->
                  <Rectangle VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                             HorizontalAlignment="Stretch"
                             Height="1"
                             Margin="0,0,0,0">
                     <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="1.003,1.074"
                                             StartPoint="0.003,0.109">
                           <GradientStop Color="#FF9A9A9A"
                                         Offset="0" />
                           <GradientStop Color="Transparent"
                                         Offset="1" />
                        </LinearGradientBrush>
                     </Rectangle.Fill>
                  </Rectangle>
               </DockPanel>
            </Border>
         </DockPanel>
      </views:PassiveLayoutDecorator>

      <ControlTemplate.Triggers>
         <Trigger Property="local:DataGridControl.NavigationBehavior"
                  Value="None">
            <Setter TargetName="mainBorder"
                    Property="Focusable"
                    Value="False" />
         </Trigger>
      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: GroupHeaderControl (When top level sticky)
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7GroupHeaderTopLevelStickyControlTemplate"
                    TargetType="local:GroupHeaderControl">

      <!-- Using this decorator will prevent the GroupHeaderControl of exceeding the width 
           defined by the grid's column. -->
      <views:PassiveLayoutDecorator Axis="Horizontal">
         <!-- This DockPanel is used to layout the GroupLevelIndicatorPane placeholder and the GroupHeaderControl Content. -->
         <DockPanel>

            <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
              whenever this GroupHeaderControl is part of a group. -->
            <local:HierarchicalGroupLevelIndicatorPane DockPanel.Dock="Left" />
            <local:GroupLevelIndicatorPane DockPanel.Dock="Left"
                                           Indented="False"
                                           local:GroupLevelIndicatorPane.GroupLevel="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel), Converter={StaticResource groupHeaderControlGroupLevelConverter}, ConverterParameter=-1}" />

            <Grid>
               <Border BorderThickness="0,0,0,1"
                       BorderBrush="#44000000">
                  <Border.Background>
                     <LinearGradientBrush EndPoint="0.477,0.939"
                                          StartPoint="0.477,0.111">
                        <GradientStop Color="#FF9ED7FE" />
                        <GradientStop Color="#FFD1ECFF"
                                      Offset="1" />
                     </LinearGradientBrush>
                  </Border.Background>
               </Border>

               <!-- Main Border for the GroupHeaderControl. It is Focusable to make the InputBindings work. -->
               <Border x:Name="mainBorder"
                       Background="{TemplateBinding Background}"
                       BorderBrush="{StaticResource borderBrush}"
                       BorderThickness="0,0,0,0"
                       Padding="{TemplateBinding Padding}"
                       Focusable="True"
                       FocusVisualStyle="{TemplateBinding FocusVisualStyle}">

                  <!-- Define all the standard InputBindings for a GroupHeaderControl. -->
                  <Border.InputBindings>
                     <KeyBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
                                 Key="Space" />

                     <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
                                 Key="Right" />

                     <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
                                 Key="Add" />

                     <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
                                 Key="Left" />

                     <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
                                 Key="Subtract" />

                     <MouseBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
                                   MouseAction="LeftDoubleClick" />

                  </Border.InputBindings>

                  <!-- This StackPanel is used to layout the ToggleButton and the GroupHeaderControl. -->
                  <StackPanel Orientation="Horizontal">

                     <!-- ToggleButton that is used to expand/collapse the group. -->
                     <ToggleButton DockPanel.Dock="Left"
                                   Template="{StaticResource groupExpanderToggleButtonTemplate}"
                                   OverridesDefaultStyle="True"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Focusable="False"
                                   IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Group.IsExpanded}" />

                     <!-- ContentPresenter in charge of displaying this GroupHeaderControl's Content, which is
                             a Group by default. -->
                     <ContentPresenter DockPanel.Dock="Left"
                                       Margin="3,0,0,0"
                                       Content="{TemplateBinding Content}"
                                       ContentTemplate="{TemplateBinding ContentTemplate}"
                                       ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                  </StackPanel>
               </Border>

               <Border x:Name="topGridLine"
                       BorderThickness="{TemplateBinding BorderThickness}"
                       BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineBrush}" />
            </Grid>

         </DockPanel>
      </views:PassiveLayoutDecorator>

      <ControlTemplate.Triggers>
         <Trigger Property="local:DataGridControl.NavigationBehavior"
                  Value="None">
            <Setter TargetName="mainBorder"
                    Property="Focusable"
                    Value="False" />
         </Trigger>
      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: HierarchicalGroupByControlNode
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7HierarchicalGroupByControlNodeTemplate"
                    TargetType="local:HierarchicalGroupByControlNode">

      <StackPanel Orientation="Horizontal"
                  Background="{TemplateBinding Background}">

         <Grid>

            <Border Background="{StaticResource hierarchicalGroupByControlNodeBackgroundBrush}"
                    CornerRadius="5" />

            <TextBlock x:Name="titleTextBlock"
                       Text="{TemplateBinding Title}"
                       Margin="4,3,4,3"
                       Foreground="#154A93"
                       VerticalAlignment="Center" />

            <Border x:Name="blackBorder"
                    BorderThickness="1"
                    BorderBrush="Black"
                    CornerRadius="5">
               <Border x:Name="whiteBorder"
                       BorderThickness="1"
                       BorderBrush="White"
                       CornerRadius="4" />
            </Border>

         </Grid>
         <ItemsPresenter Margin="0,0,0,0" />
      </StackPanel>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: HierarchicalGroupByControl
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7HierarchicalGroupByControlTemplate"
                    TargetType="local:HierarchicalGroupByControl">
      <ControlTemplate.Resources>
         <!--this style is set to avoid having implicit treeview style
             overide the HierarchicalGroupByControl's TreeView-->
         <Style TargetType="TreeView" />
      </ControlTemplate.Resources>

      <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the HierarchicalGroupByControl -->
      <Grid x:Name="rootGrid">
         <Grid.ColumnDefinitions>
            <!-- HierarchicalGroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />
            <!-- GroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />

            <!-- HierarchicalGroupByControl -->
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>

         <!-- The border responsible for the visual outline of the row (gridlines and background)
              spans the GroupLevelIndicatorPane and CellsHost Panel. Those 2 elements are not children of
              the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
         <Border x:Name="rootBorder"
                 Grid.Column="1"
                 Grid.ColumnSpan="2"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineBrush}"
                 BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Top'}"
                 Padding="{TemplateBinding Padding}" />

         <Border x:Name="verticalGridLineBorder"
                 Grid.Column="1"
                 Grid.ColumnSpan="2"
                 BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}"
                 BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right'}" />

         <Border VerticalAlignment="Stretch"
                 HorizontalAlignment="Stretch"
                 Grid.ColumnSpan="3">
            <Border.Background>
               <VisualBrush AlignmentX="Left"
                            Stretch="Uniform">
                  <VisualBrush.Visual>
                     <ContentPresenter ContentTemplate="{StaticResource CurvyLeavesPattern}"
                                       VerticalAlignment="Stretch"
                                       HorizontalAlignment="Stretch" />
                  </VisualBrush.Visual>
               </VisualBrush>
            </Border.Background>
         </Border>

         <local:HierarchicalGroupLevelIndicatorPane Grid.Column="0" />

         <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
                       whenever this Row is part of a group. -->
         <local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
                                        Grid.Column="1" />

         <StackPanel Grid.Column="2"
                     Orientation="Horizontal">

            <TreeView x:Name="PART_HierarchicalGroupByControlTreeView"
                      ItemContainerStyle="{StaticResource hierarchicalGroupByControlTreeViewItemStyle}"
                      Background="Transparent"
                      BorderBrush="Transparent"
                      Focusable="False">

               <TreeViewItem Header="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext)}"
                             HeaderTemplate="{StaticResource dataGridContextTemplate}"
                             ItemsSource="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DetailConfigurations}"
                             ItemTemplate="{StaticResource detailConfigurationTemplate}"
                             ItemContainerStyle="{StaticResource hierarchicalGroupByControlTreeViewItemStyle}"
                             IsExpanded="True" />
            </TreeView>

            <ContentPresenter x:Name="noGroupContentPresenter"
                              Content="{TemplateBinding NoGroupContent}"
                              VerticalAlignment="Center"
                              Visibility="Collapsed"
                              Margin="5,0,0,0" />

         </StackPanel>

      </Grid>
      <ControlTemplate.Triggers>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=HasGroups}"
                      Value="True">

            <Setter TargetName="noGroupContentPresenter"
                    Property="Visibility"
                    Value="Visible" />

         </DataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel)}"
                      Value="-1">
            <Setter TargetName="groupLevelIndicatorPane"
                    Property="Visibility"
                    Value="Collapsed" />
            <Setter TargetName="verticalGridLineBorder"
                    Property="BorderThickness"
                    Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right, Left'}" />
         </DataTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: HierarchicalGroupByItem
    ************************** -->
   <ControlTemplate x:Key="tableflowViewHierarchicalGroupByItemTemplate"
                    TargetType="local:HierarchicalGroupByItem">
      <Grid>
         <Border x:Name="mouseOverEffect"
                 Opacity="0"
                 CornerRadius="5"
                 Background="{StaticResource groupByItemMouseOverBackgroundBrush}" />

         <Border x:Name="mainBorder"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}"
                 CornerRadius="5">

            <!-- This StackPanel is used to layout the ContentPresenter and the Sort Glyph (when present). -->
            <StackPanel Orientation="Horizontal">

               <!-- Same ContentPresenter as in the base Cell Template. -->
               <ContentPresenter Content="{TemplateBinding Content}"
                                 ContentTemplate="{TemplateBinding ContentTemplate}"
                                 ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 Margin="0,4" />

               <!-- ContentPresenter that is used to display the sort glyph.
                 We explicitely set its Content property to Null to prevent the XAML parser
                 from implicitely setting it to its TemplatedParent's Content. -->
               <ContentPresenter x:Name="sortGlyphPresenter"
                                 Content="{x:Null}"
                                 ContentTemplate="{x:Null}"
                                 Margin="15,0,0,0"
                                 TextBlock.Foreground="Black" />

            </StackPanel>
         </Border>

         <Border x:Name="blackBorder"
                 BorderThickness="1"
                 BorderBrush="{StaticResource basicBlackBorderBrush}"
                 CornerRadius="5">
            <Border x:Name="whiteBorder"
                    BorderThickness="1"
                    BorderBrush="{StaticResource basicWhiteBorderBrush}"
                    CornerRadius="4" />
         </Border>

      </Grid>
      <ControlTemplate.Triggers>

         <Trigger Property="IsMouseOver"
                  Value="true">
            <Setter TargetName="mouseOverEffect"
                    Property="Opacity"
                    Value="1" />
         </Trigger>

         <Trigger Property="IsPressed"
                  Value="true">
            <Setter TargetName="mainBorder"
                    Property="Background"
                    Value="{StaticResource groupByItemPressedBackgroundBrush}" />
         </Trigger>

         <!-- The following 2 triggers allow to display the appropriate Sort Glyph
              depending on the ParentColumn's SortDirection. -->
         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
                      Value="Ascending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" />

            <Setter TargetName="sortGlyphPresenter"
                    Property="Margin"
                    Value="6,0,0,0" />

         </DataTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
                      Value="Descending">

            <Setter TargetName="sortGlyphPresenter"
                    Property="ContentPresenter.ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" />

            <Setter TargetName="sortGlyphPresenter"
                    Property="Margin"
                    Value="6,0,0,0" />

         </DataTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: ColumnManagerRow 
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7ColumnManagerRowTemplate"
                    TargetType="local:ColumnManagerRow">
      <!-- A basic Row Template requires at least a Panel named "PART_CellsHost" to which the Row's cells will be added.
           This Panel is usually placed inside a Border who is responsible for painting the gridlines. -->

      <ControlTemplate.Resources>
         <conv:ThicknessConverter x:Key="thicknessConverter"
                                  InverseValue="True" />
      </ControlTemplate.Resources>

      <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the CellsHost panel. -->
      <Grid x:Name="rootGrid">
         <Grid.ColumnDefinitions>
            <!-- HierarchicalGroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />
            <!-- GroupLevelIndicatorPane -->
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />

            <!-- CellsHost panel -->
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>

         <!-- The border responsible for the visual outline of the row (gridlines and background)
                       spans the GroupLevelIndicatorPane and CellsHost Panel. Those 2 elements are not children of
                       the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
         <Border x:Name="rootBorder"
                 Grid.Column="1"
                 Grid.ColumnSpan="3"
                 views:TableView.CanScrollHorizontally="False"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}" />

         <Border Grid.Column="1"
                 Grid.ColumnSpan="3"
                 BorderBrush="Black"
                 BorderThickness="0,1"
                 views:TableView.CanScrollHorizontally="False" />

         <Border Grid.Column="1"
                 Grid.ColumnSpan="3"
                 BorderBrush="{StaticResource columnManagerRowWhiteBorderBrush}"
                 BorderThickness="0,1"
                 Margin="0,1"
                 views:TableView.CanScrollHorizontally="False" />

         <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
                       whenever this Row is part of a group. -->
         <local:HierarchicalGroupLevelIndicatorPane views:TableView.CanScrollHorizontally="False"
                                                    Grid.Column="0" />
         <local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
                                        views:TableView.CanScrollHorizontally="False"
                                        Grid.Column="1" />

         <!-- Button that is used to expand/collapse the group. -->
         <Button x:Name="detailsToggle"
                 Template="{StaticResource detailsExpanderButtonTemplate}"
                 Grid.Column="2"
                 Margin="2,0,2,0"
                 Command="{x:Static local:DataGridCommands.ToggleDetailExpansion}"
                 OverridesDefaultStyle="True"
                 Focusable="False"
                 Visibility="Collapsed"
                 views:TableView.CanScrollHorizontally="False" />

         <!-- The PART_CellsHost part designates the Panel to which this Row's Cells should be added.-->
         <Decorator x:Name="indentationDecorator"
                    Grid.Column="3">
            <views:FixedCellPanel x:Name="PART_CellsHost"
                                  ColumnStretchMinWidth="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMinWidth}"
                                  ColumnStretchMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMode}"
                                  FixedCellCount="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnCount, Mode=TwoWay}"
                                  FixedColumnDropMarkPen="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnDropMarkPen}"
                                  Margin="{TemplateBinding BorderThickness}" />
         </Decorator>

      </Grid>

      <ControlTemplate.Triggers>

         <!-- When there are details, display the Toggle button for the expansion, collapsing of the details -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
                          Value="True" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="detailsToggle"
                    Property="Visibility"
                    Value="Hidden" />

         </MultiDataTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: Cell 
    ************************** -->
   <ControlTemplate x:Key="tableflowViewWindows7CellTemplate"
                    TargetType="local:Cell">

      <ControlTemplate.Resources>
         <conv:TypeToBooleanConverter x:Key="typeToBooleanConverter" />
      </ControlTemplate.Resources>

      <Grid>

         <Border x:Name="rootBorder"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}">
            <Grid>

               <local:CellContentPresenter x:Name="PART_CellContentPresenter"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

               <!-- This Presenter is used to show the glyph watermark for Insertion and Filter rows -->
               <ContentPresenter x:Name="glyphPresenter"
                                 Opacity="0.2"
                                 Grid.Column="3"
                                 Margin="3,9"
                                 VerticalAlignment="Top"
                                 HorizontalAlignment="Left"
                                 Content="{x:Null}" />
            </Grid>
         </Border>

         <Border x:Name="selectionBorder"
                 BorderBrush="{StaticResource dataGridControlBackgroundBrush}"
                 BorderThickness="0" />

         <Border x:Name="darkBorder"
                 BorderBrush="{StaticResource currentCellBlackBorderBrush}"
                 BorderThickness="1"
                 Opacity="0">
            <Border x:Name="lightBorder"
                    BorderBrush="{StaticResource currentCellWhiteBorderBrush}"
                    BorderThickness="1"
                    Opacity="0">
            </Border>
         </Border>

      </Grid>

      <ControlTemplate.Triggers>

         <!-- When changing the appearance (e.g., background/foreground) of the Cell to reflect specific
              states (e.g., IsCurrent), it is recommended to apply the changes directly to the template
              elements because we want those modifications to be effective even when a value has been
              explicitly set to these properties on the TemplatedParent. Also, when someone queries
              the value of these properties on the TemplatedParent, we don't want to return the
              intermediate, state-specific values. -->

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).SelectionUnit}"
                          Value="Cell" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="selectionBorder"
                    Property="BorderThickness"
                    Value="1" />

            <Setter TargetName="rootBorder"
                    Property="Background">
               <Setter.Value>
                  <RadialGradientBrush Center="0.503,0.35"
                                       GradientOrigin="1.009,0.295"
                                       RadiusX="0.636"
                                       RadiusY="2.375">
                     <GradientStop Color="#FF04A2F7" />
                     <GradientStop Color="#FF86E9F9"
                                   Offset="1" />
                     <GradientStop Color="#FF86E9F9"
                                   Offset="0.5" />
                  </RadialGradientBrush>
               </Setter.Value>
            </Setter>
         </MultiDataTrigger>

         <!-- When the Cell is Current, we want to change its background/foreground to the appropriate brushes.
              We do this only when the cell does not have a validation error because we must give priority
              to the CellErrorStyle (if present).-->

         <MultiTrigger>
            <MultiTrigger.Conditions>

               <Condition Property="IsCurrent"
                          Value="True" />

               <Condition Property="HasValidationError"
                          Value="False" />

            </MultiTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentBackground}" />

            <Setter TargetName="rootBorder"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentForeground}" />

         </MultiTrigger>

         <MultiTrigger>
            <MultiTrigger.Conditions>

               <Condition Property="IsCurrent"
                          Value="True" />

               <Condition Property="HasValidationError"
                          Value="True" />

               <Condition Property="CellErrorStyle"
                          Value="{x:Null}" />

            </MultiTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentBackground}" />

            <Setter TargetName="rootBorder"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentForeground}" />

         </MultiTrigger>

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=IsCurrent}"
                      Value="True">

            <Setter TargetName="darkBorder"
                    Property="Opacity"
                    Value="1" />
            <Setter TargetName="lightBorder"
                    Property="Opacity"
                    Value="1" />

         </DataTrigger>

         <!-- When the Cell's content is Null and the row is not being edited, we want to ensure that the row/cell
              will preserve a minimum height based on the current font size for the row/cell. To do this, we override
              the ContentPresenter's content binding and replace it with an empty string (""), the textbox generated 
              this way will then size to the default text's height. When the trigger is not active anymore, default binding
              is restored automatically. -->

         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.Visible}"
                      Value="False">
            <Setter Property="Visibility"
                    Value="Collapsed" />
         </DataTrigger>

         <!-- When the Cell is Selected but the parent DataGridControl is not focused, we want to change
              the Cell's background to the appropriate brushes. -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsCurrent}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).IsKeyboardFocusWithin}"
                          Value="False" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).HideSelection}"
                          Value="False" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentBackground}" />

         </MultiDataTrigger>

         <!-- When the Cell is Selected, we want to change its background/foreground to the appropriate brushes. -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).IsKeyboardFocusWithin}"
                          Value="True" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="selectionBorder"
                    Property="BorderThickness"
                    Value="1" />

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionBackground}" />

            <Setter TargetName="rootBorder"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionForeground}" />

         </MultiDataTrigger>

         <!-- When the Cell is Selected but the parent DataGridControl is not focused, we want to change
              the Cell's background/foreground to the appropriate brushes. -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
                          Value="True" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).IsKeyboardFocusWithin}"
                          Value="False" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).HideSelection}"
                          Value="False" />

            </MultiDataTrigger.Conditions>

            <Setter TargetName="selectionBorder"
                    Property="BorderThickness"
                    Value="1" />

            <Setter TargetName="rootBorder"
                    Property="Background"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionBackground}" />

            <Setter TargetName="rootBorder"
                    Property="TextElement.Foreground"
                    Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionForeground}" />

         </MultiDataTrigger>

      </ControlTemplate.Triggers>

   </ControlTemplate>

   <!-- =================================================================== -->
   <!-- Styles required by some grid elements                               -->
   <!-- =================================================================== -->

   <!--**************************
    * STYLE: CellErrorStyle 
    ************************** -->
   <Style x:Key="cellErrorStyle"
          TargetType="local:Cell">

      <Setter Property="Background"
              Value="{StaticResource errorBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="{StaticResource errorForegroundBrush}" />

      <Setter Property="ToolTip"
              Value="{Binding RelativeSource={RelativeSource Self},Path=ValidationError.ErrorContent}" />

      <Style.Triggers>
         <Trigger Property="IsValidationErrorRestrictive"
                  Value="True">
            <Setter Property="Background"
                    Value="{StaticResource errorBackgroundBrush}" />

         </Trigger>

         <Trigger Property="IsValidationErrorRestrictive"
                  Value="False">

            <Setter Property="Foreground"
                    Value="{StaticResource warningForegroundBrush}" />

            <Setter Property="Background"
                    Value="{StaticResource warningBackgroundBrush}" />

         </Trigger>
      </Style.Triggers>

   </Style>

   <!-- =================================================================== -->
   <!-- Keyed Styles of grid elements                                       -->
   <!-- =================================================================== -->

   <!--**************************
    * STYLE: DataGridControl 
    ************************** -->
   <Style x:Key="tableflowViewWindows7GridControlStyle"
          TargetType="local:DataGridControl">

      <!-- Include ControlTemplates of common controls -->
      <Style.Resources>
         <markup:DataGridThemeResourceDictionary Source="Resources/Windows7.Controls.xaml" />
      </Style.Resources>

      <Setter Property="BorderBrush"
              Value="{StaticResource gridControlBorderBrush}" />

      <Setter Property="BorderThickness"
              Value="1" />

      <Setter Property="Background"
              Value="{StaticResource dataGridControlBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />

      <!-- This is required to display gridlines of uniform thickness -->
      <Setter Property="SnapsToDevicePixels"
              Value="True" />

      <Setter Property="TextElement.FontFamily"
              Value="Calibri" />

      <Setter Property="CellErrorStyle"
              Value="{StaticResource cellErrorStyle}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewDataGridControlTemplate}" />

   </Style>

   <!--**************************
    * STYLE: RowSelectorPane
    ************************** -->
   <Style x:Key="tableflowViewWindows7RowSelectorPaneStyle"
          TargetType="local:RowSelectorPane">

      <Setter Property="Background"
              Value="{StaticResource rowSelectorBrush}" />

      <Setter Property="TextElement.Foreground"
              Value="{StaticResource darkBorderBrush}" />

   </Style>

   <!--**************************
    * STYLE: RowSelector 
    ************************** -->
   <conv:TypeToBooleanConverter x:Key="rowTypeConverter" />
   <Style x:Key="tableflowViewWindows7RowSelectorStyle"
          TargetType="local:RowSelector">

      <!-- Set the RowSelector's background to Transparent to make it hit-testable
           while preserving the background drawn by the underlying RowSelectorPane. -->
      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="HorizontalContentAlignment"
              Value="Center" />

      <Setter Property="VerticalContentAlignment"
              Value="Top" />

      <Setter Property="Padding"
              Value="2" />

      <Setter Property="BorderBrush"
              Value="Transparent" />

      <Setter Property="BorderThickness"
              Value="0,0,1,0" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7RowSelectorTemplate}" />

      <Style.Triggers>

         <!-- The DataContext of a RowSelector is always set to its corresponding
              Row/item. This is why we use DataTriggers with no explicit Binding Source
              when we want to react to properties of the Row/item. -->

         <!-- When the Row is Current, display the current glyph in the RowSelector -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsCurrent}"
                          Value="True" />
            </MultiDataTrigger.Conditions>
            <Setter Property="ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).CurrentItemGlyph}" />
         </MultiDataTrigger>

         <!-- When the Row is being edited, display the appropriate glyph in the RowSelector. -->
         <Trigger Property="IsBeingEdited"
                  Value="True">
            <Setter Property="ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).EditingRowGlyph}" />

         </Trigger>

         <!-- When the Row has a validation error, display the appropriate glyph in the RowSelector. -->
         <Trigger Property="HasValidationError"
                  Value="True">
            <Setter Property="ContentTemplate"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ValidationErrorGlyph}" />
         </Trigger>

      </Style.Triggers>

   </Style>

   <!--**************************
    * STYLE: Row
    ************************** -->
   <Style x:Key="tableflowViewWindows7RowStyle"
          TargetType="local:Row">

      <Setter Property="FocusVisualStyle"
              Value="{StaticResource tableflowViewRowFocusVisualStyle}" />

      <Setter Property="SelectionBackground"
              Value="{StaticResource rowSelectionBackgroundBrush}" />

      <Setter Property="SelectionForeground"
              Value="Black" />

      <Setter Property="InactiveSelectionBackground"
              Value="{StaticResource rowInactiveSelectionBackgroundBrush}" />

      <Setter Property="InactiveSelectionForeground"
              Value="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}" />

      <!-- The Row is responsible for drawing the horizontal gridlines. It draws only its top gridline,
           assuming that the bottom gridline will be drawn by its following row/element -->
      <Setter Property="BorderThickness"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Top'}" />

      <Setter Property="BorderBrush"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineBrush}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7RowTemplate}" />

      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="Foreground"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentForeground}" />

      <Style.Triggers>
         <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(views:ViewBase.IsLastItem)}"
                      Value="True">
            <Setter Property="BorderThickness"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Top, Bottom'}" />
         </DataTrigger>

         <!-- Enabled/Disabled Odd datarow style alternation -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).IsAlternatingRowStyleEnabled}"
                          Value="True" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridVirtualizingPanel.ItemIndex), Converter={x:Static conv:IndexToOddConverter.Singleton}}"
                          Value="True" />
            </MultiDataTrigger.Conditions>

            <Setter Property="Background"
                    Value="{StaticResource rowAlternatingBackgroundBrush}" />

         </MultiDataTrigger>
      </Style.Triggers>

   </Style>

   <!--**************************
    * STYLE: DataRow 
    ************************** -->
   <Style x:Key="tableflowViewWindows7DataRowStyle"
          TargetType="local:DataRow"
          BasedOn="{StaticResource tableflowViewWindows7RowStyle}">
   </Style>

   <!--**************************
    * STYLE: ColumnManagerRow 
    ************************** -->
   <Style x:Key="tableflowViewWindows7ColumnManagerRowStyle"
          TargetType="local:ColumnManagerRow"
          BasedOn="{StaticResource tableflowViewWindows7RowStyle}">

      <!-- Use a different background and foreground than the base Row style. -->

      <Setter Property="Background"
              Value="{StaticResource columnManagerRowBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="{StaticResource gridControlForegroundBrush}" />

      <Setter Property="BorderBrush"
              Value="{StaticResource columnManagerRowBorderBrush}" />

      <Setter Property="BorderThickness"
              Value="0,1,0,1" />

      <Setter Property="local:RowSelector.Visible"
              Value="False" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7ColumnManagerRowTemplate}" />

      <Style.Triggers>
         <Trigger Property="local:GroupLevelIndicatorPane.GroupLevel"
                  Value="-1">
            <!-- We don't want to display the Group Margins for the ColumnManagerRow. -->
            <Setter Property="local:GroupLevelIndicatorPane.ShowIndicators"
                    Value="False" />
         </Trigger>

      </Style.Triggers>

   </Style>

   <!--**************************
    * STYLE: Cell Style
    ************************** -->
   <Style x:Key="tableflowViewWindows7CellStyle"
          TargetType="local:Cell">

      <Setter Property="CurrentBackground"
              Value="{StaticResource currentCellBackgroundBrush}" />

      <Setter Property="CurrentForeground"
              Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />

      <Setter Property="SelectionBackground"
              Value="{StaticResource rowSelectionBackgroundBrush}" />

      <Setter Property="SelectionForeground"
              Value="Black" />

      <Setter Property="InactiveSelectionBackground"
              Value="{StaticResource rowInactiveSelectionBackgroundBrush}" />

      <Setter Property="InactiveSelectionForeground"
              Value="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}" />

      <!-- Set the Cell's background to Transparent to make it hit-testable
           while preserving the background drawn by the underlying Row. -->
      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="Foreground"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentForeground}" />

      <!-- In TableflowView, each Cell has the same width as its ParentColum's ActualWidth -->
      <Setter Property="Width"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.ActualWidth}" />

      <Setter Property="Padding"
              Value="{StaticResource cellPadding}" />

      <Setter Property="HorizontalContentAlignment"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.CellHorizontalContentAlignment, FallbackValue=Stretch}" />

      <Setter Property="VerticalContentAlignment"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.CellVerticalContentAlignment, FallbackValue=Stretch}" />

      <Setter Property="BorderThickness"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Right'}" />

      <Setter Property="BorderBrush"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7CellTemplate}" />

   </Style>

   <!--**************************
    * STYLE: DataCell
    ************************** -->
   <Style x:Key="tableflowViewWindows7DataCellStyle"
          TargetType="local:DataCell"
          BasedOn="{StaticResource tableflowViewWindows7CellStyle}" />

   <!--**************************
    * STYLE: ColumnManagerCell 
    ************************** -->
   <Style x:Key="tableflowViewWindows7ColumnManagerCellStyle"
          TargetType="local:ColumnManagerCell">

      <!-- Set the Cell's background to Transparent to make it hit-testable
           while preserving the background drawn by the underlying Row. -->
      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="TextElement.Foreground"
              Value="White" />

      <!-- In TableflowView, each Cell has the same width as its ParentColum's ActualWidth -->
      <Setter Property="Width"
              Value="{Binding RelativeSource={RelativeSource Self},Path=ParentColumn.ActualWidth}" />

      <Setter Property="Padding"
              Value="4,3,0,7" />

      <Setter Property="HorizontalContentAlignment"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.CellHorizontalContentAlignment, FallbackValue=Stretch}" />

      <Setter Property="VerticalContentAlignment"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.CellVerticalContentAlignment, FallbackValue=Stretch}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7ColumnManagerCellTemplate}" />

   </Style>

   <!--**************************
    * STYLE: GroupByControl 
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupByControlStyle"
          TargetType="local:GroupByControl">

      <!-- If we don't specify a MinHeight, the default "size-to-content" behavior will arrange 
           the control with a Height of 0, which makes it invisible and unusable.
           In a typical TableflowView, a height of at least 25 is appropriate for the GroupByControl. -->
      <Setter Property="MinHeight"
              Value="25" />

      <Setter Property="ConnectionLinePen"
              Value="{StaticResource groupByConnectionLinePen}" />

      <Setter Property="Background"
              Value="{StaticResource groupByControlBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="Black" />

      <Setter Property="Padding"
              Value="8" />

      <Setter Property="local:RowSelector.Visible"
              Value="False" />

      <Setter Property="views:TableView.CanScrollHorizontally"
              Value="False" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7GroupByControlTemplate}" />

   </Style>

   <!--**************************
    * STYLE: GroupByItem
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupByItemStyle"
          TargetType="local:GroupByItem">

      <Setter Property="Background"
              Value="{StaticResource groupByItemBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="Black" />

      <Setter Property="Padding"
              Value="{StaticResource cellPadding}" />

      <Setter Property="BorderBrush"
              Value="Transparent" />

      <Setter Property="BorderThickness"
              Value="1" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7GroupByItemTemplate}" />

   </Style>

   <!--**************************
    * STYLE: GroupHeaderControl 
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupHeaderControlStyle"
          TargetType="local:GroupHeaderControl">

      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="Foreground"
              Value="{StaticResource headerForegroundBrush}" />

      <Setter Property="SelectionBackground"
              Value="{StaticResource rowSelectionBackgroundBrush}" />

      <Setter Property="SelectionForeground"
              Value="Black" />

      <Setter Property="InactiveSelectionBackground"
              Value="{StaticResource rowInactiveSelectionBackgroundBrush}" />

      <Setter Property="InactiveSelectionForeground"
              Value="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}" />

      <Setter Property="views:TableView.CanScrollHorizontally"
              Value="False" />

      <Setter Property="BorderThickness"
              Value="0,0,0,0" />

      <Setter Property="BorderBrush"
              Value="{StaticResource borderBrush}" />

      <Setter Property="Padding"
              Value="{StaticResource cellPadding}" />

      <Setter Property="VerticalContentAlignment"
              Value="Center" />

      <!-- The GroupHeaderControl itself must not be focusable. The main Border inside its Template will
           be made Focusable because it is holding the various InputBindings that make the
           GroupHeaderControl work. -->
      <Setter Property="Focusable"
              Value="False" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7GroupHeaderControlTemplate}" />

      <Style.Triggers>
         <Trigger Property="local:GroupLevelIndicatorPane.GroupLevel"
                  Value="0">
            <Setter Property="BorderThickness"
                    Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Top'}" />
         </Trigger>

         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content.IsBottomLevel}"
                          Value="False" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content.Level}"
                          Value="0" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AreGroupHeadersSticky}"
                          Value="True" />
               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AreGroupsFlattened}"
                          Value="True" />
            </MultiDataTrigger.Conditions>

            <Setter Property="Template"
                    Value="{StaticResource tableflowViewWindows7GroupHeaderTopLevelStickyControlTemplate}" />
         </MultiDataTrigger>
      </Style.Triggers>

   </Style>

   <!--**************************
    * STYLE: GroupLevelIndicator
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupLevelIndicatorStyle"
          TargetType="local:GroupLevelIndicator">

      <!--<Setter Property="Background"
              Value="Transparent" />

      <Setter Property="Foreground"
              Value="{StaticResource gridControlForegroundBrush}" />-->

      <Setter Property="Width"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).GroupLevelIndicatorWidth}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewGroupLevelIndicatorTemplate}" />

   </Style>

   <!--**************************
    * STYLE: DetailIndicator
    ************************** -->
   <Style x:Key="tableflowViewWindows7DetailIndicatorStyle"
          TargetType="local:DetailIndicator">

      <Setter Property="Background"
              Value="{x:Null}" />

      <Setter Property="Width"
              Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DetailIndicatorWidth}" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewDetailIndicatorTemplate}" />

   </Style>

   <!--**************************
    * STYLE: GroupLevelIndicatorPane
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupLevelIndicatorPaneStyle"
          TargetType="local:GroupLevelIndicatorPane">

      <Setter Property="Template"
              Value="{StaticResource tableflowViewGroupLevelIndicatorPaneTemplate}" />

      <Style.Triggers>
         <MultiTrigger>
            <MultiTrigger.Conditions>
               <Condition Property="IsLeaf"
                          Value="False" />
               <Condition Property="views:ViewBase.IsLastItem"
                          Value="True" />
            </MultiTrigger.Conditions>

            <Setter Property="Margin"
                    Value="0,0,0,-5" />
         </MultiTrigger>

      </Style.Triggers>
   </Style>

   <!--**************************
    * STYLE: HierarchicalGroupLevelIndicatorPane
    ************************** -->
   <Style x:Key="tableflowViewWindows7HierarchicalGroupLevelIndicatorPaneStyle"
          TargetType="local:HierarchicalGroupLevelIndicatorPane">

      <Setter Property="Template"
              Value="{StaticResource tableflowViewHierarchicalGroupLevelIndicatorPaneTemplate}" />

      <Setter Property="local:GroupLevelIndicatorPane.ShowIndicators"
              Value="True" />

      <Setter Property="local:GroupLevelIndicatorPane.ShowVerticalBorder"
              Value="True" />

      <Style.Triggers>
         <Trigger Property="local:GroupLevelIndicatorPane.GroupLevel"
                  Value="-1">

            <!-- Stop the propagation of the value set by the default style trigger of
                 the ColumnManagerRow -->
            <Setter Property="local:GroupLevelIndicatorPane.ShowIndicators"
                    Value="True" />

         </Trigger>
      </Style.Triggers>
   </Style>

   <!--**************************
    * STYLE: HierarchicalGroupByControlNode
    ************************** -->
   <Style x:Key="tableflowViewWindows7HierarchicalGroupByControlNodeStyle"
          TargetType="local:HierarchicalGroupByControlNode">

      <Setter Property="StairHeight"
              Value="0" />

      <Setter Property="ConnectionLineOffset"
              Value="0" />

      <Setter Property="Focusable"
              Value="False" />

      <Setter Property="ConnectionLineAlignment"
              Value="CenterToCenter" />

      <Setter Property="Margin"
              Value="4" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7HierarchicalGroupByControlNodeTemplate}" />

   </Style>

   <!--**************************
    * STYLE: HierarchicalGroupByControl
    ************************** -->
   <Style x:Key="tableflowViewWindows7HierarchicalGroupByControlStyle"
          TargetType="local:HierarchicalGroupByControl">

      <!-- If we don't specify a MinHeight, the default "size-to-content" behavior will arrange 
           the control with a Height of 0, which makes it invisible and unusable.
           In a typical TableflowView, a height of at least 25 is appropriate for the GroupByControl. -->
      <Setter Property="MinHeight"
              Value="25" />

      <Setter Property="Background"
              Value="{StaticResource groupByControlBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="#15428B" />

      <Setter Property="Padding"
              Value="8" />

      <Setter Property="StairHeight"
              Value="0" />

      <Setter Property="ConnectionLineOffset"
              Value="0" />

      <Setter Property="ConnectionLineAlignment"
              Value="CenterToCenter" />

      <Setter Property="ConnectionLinePen"
              Value="{StaticResource groupByConnectionLinePen}" />

      <Setter Property="local:RowSelector.Visible"
              Value="False" />

      <Setter Property="views:TableView.CanScrollHorizontally"
              Value="False" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7HierarchicalGroupByControlTemplate}" />

      <Style.Triggers>

         <!-- We use the old GroupByControl Template if there are no Details in the DataGridControl.ItemsSource -->
         <MultiDataTrigger>
            <MultiDataTrigger.Conditions>

               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
                          Value="False" />

               <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ParentDataGridContext, Converter={StaticResource nullToBooleanConverter}}"
                          Value="True" />

            </MultiDataTrigger.Conditions>

            <Setter Property="Template"
                    Value="{StaticResource tableflowViewCommonHierarchicalGroupByControlOldGroupByControlTemplate}" />

         </MultiDataTrigger>

      </Style.Triggers>

   </Style>

   <!--**************************
    * STYLE: HierarchicalGroupByItem
    ************************** -->
   <Style x:Key="tableflowViewWindows7HierarchicalGroupByItemStyle"
          TargetType="local:HierarchicalGroupByItem">

      <Setter Property="Background"
              Value="{StaticResource groupByItemBackgroundBrush}" />

      <Setter Property="Foreground"
              Value="#154A93" />

      <Setter Property="Margin"
              Value="4,0,4,0" />

      <Setter Property="Padding"
              Value="{StaticResource cellPadding}" />

      <Setter Property="BorderBrush"
              Value="Transparent" />

      <Setter Property="BorderThickness"
              Value="1" />

      <Setter Property="Template"
              Value="{StaticResource tableflowViewHierarchicalGroupByItemTemplate}" />

   </Style>

   <!--**************************
    * STYLE: GroupNavigationControl
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupNavigationControlStyle"
          TargetType="local:GroupNavigationControl">
      <Setter Property="Background"
              Value="Transparent" />
      <Setter Property="BorderBrush"
              Value="Transparent" />
      <Setter Property="BorderThickness"
              Value="0" />
      <Setter Property="Template"
              Value="{StaticResource tableflowViewWindows7GroupNavigationControlTemplate}" />
   </Style>

   <!--**************************
    * STYLE: GroupNavigationControlItem
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupNavigationControlItemStyle"
          TargetType="{x:Type local:GroupNavigationControlItem}">

      <Setter Property="Background"
              Value="Transparent" />

      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:GroupNavigationControlItem}">
               <Grid SnapsToDevicePixels="true">
                  <Border x:Name="Border"
                          Background="{TemplateBinding Background}" />
                  <Border Margin="2">
                     <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                  </Border>
               </Grid>
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver"
                           Value="true">
                     <Setter Property="Background"
                             Value="#FF86E9F9" />
                     <Setter Property="Foreground"
                             Value="Black" />
                  </Trigger>

                  <Trigger Property="IsEnabled"
                           Value="false">
                     <Setter Property="Foreground"
                             Value="Gray" />
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

   <!--**************************
    * STYLE: GroupNavigationButton
    ************************** -->
   <Style x:Key="tableflowViewWindows7GroupNavigationButtonStyle"
          TargetType="local:GroupNavigationButton">
      <Setter Property="BorderBrush"
              Value="Transparent" />
      <Setter Property="BorderThickness"
              Value="0" />
      <Setter Property="Foreground"
              Value="{StaticResource headerForegroundBrush}" />
      <Setter Property="Template"
              Value="{StaticResource tableflowViewGroupNavigationButtonTemplate}" />
   </Style>

   <!--**************************
    * STYLE: ScrollTip
    ************************** -->
   <Style x:Key="tableflowViewWindows7ScrollTipStyle"
          TargetType="local:ScrollTip">

      <Setter Property="Template"
              Value="{StaticResource scrollTipTemplate}" />

      <Setter Property="Background">
         <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0">
               <GradientStop Color="#FF56D0F9"
                             Offset="0" />
               <GradientStop Offset="0.53" />
               <GradientStop Color="#FF56D0F9"
                             Offset="0.987" />
            </LinearGradientBrush>
         </Setter.Value>
      </Setter>

      <Setter Property="BorderBrush"
              Value="Transparent" />

      <Setter Property="TextElement.Foreground"
              Value="Black" />

      <Setter Property="VerticalAlignment"
              Value="Center" />

      <Setter Property="HorizontalAlignment"
              Value="Right" />

   </Style>

   <!-- =================================================================== -->
   <!-- Default values for the View                                         -->
   <!-- =================================================================== -->

   <Style x:Key="tableflowViewWindows7DefaultValues"
          TargetType="views:TableflowView">

      <Setter Property="ContainerHeight"
              Value="30" />

      <Setter Property="VerticalGridLineBrush"
              Value="{StaticResource lightBackgroundBrush}" />

      <Setter Property="VerticalGridLineThickness"
              Value="0" />

      <Setter Property="HorizontalGridLineBrush"
              Value="{StaticResource lightBackgroundBrush}" />

      <Setter Property="HorizontalGridLineThickness"
              Value="0" />

      <Setter Property="GroupLevelIndicatorWidth"
              Value="17" />

      <Setter Property="DetailIndicatorWidth"
              Value="34" />

      <Setter Property="DefaultDropMarkPen"
              Value="{StaticResource dropMarkPen}" />

      <!-- Those glyphs are null by default on ViewBase, so every Theme should define
           and set their own custom glyphs. -->

      <Setter Property="AscendingSortGlyph"
              Value="{StaticResource ascendingSortGlyph}" />

      <Setter Property="DescendingSortGlyph"
              Value="{StaticResource descendingSortGlyph}" />

      <Setter Property="ExpandGroupGlyph"
              Value="{StaticResource expandGroupGlyph}" />

      <Setter Property="CollapseGroupGlyph"
              Value="{StaticResource collapseGroupGlyph}" />

      <Setter Property="CurrentItemGlyph"
              Value="{StaticResource currentItemGlyph}" />

      <Setter Property="EditingRowGlyph"
              Value="{StaticResource editingRowGlyph}" />

      <Setter Property="ValidationErrorGlyph"
              Value="{StaticResource validationErrorGlyph}" />

      <Setter Property="ConnectionStateLoadingGlyph"
              Value="{StaticResource connectionStateLoadingGlyph}" />

      <Setter Property="ConnectionStateCommittingGlyph"
              Value="{StaticResource connectionStateLoadingGlyph}" />

      <Setter Property="ConnectionStateErrorGlyph"
              Value="{StaticResource connectionStateErrorGlyph}" />

   </Style>

   <!-- =================================================================== -->
   <!-- DefaultStyleKey declarations                                        -->
   <!-- =================================================================== -->

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme}"
          TargetType="views:TableflowView"
          BasedOn="{StaticResource tableflowViewWindows7DefaultValues}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:DataGridControl}"
          TargetType="local:DataGridControl"
          BasedOn="{StaticResource tableflowViewWindows7GridControlStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:RowSelectorPane}"
          TargetType="local:RowSelectorPane"
          BasedOn="{StaticResource tableflowViewWindows7RowSelectorPaneStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:RowSelector}"
          TargetType="local:RowSelector"
          BasedOn="{StaticResource tableflowViewWindows7RowSelectorStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:Row}"
          TargetType="local:Row"
          BasedOn="{StaticResource tableflowViewWindows7RowStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:DataRow}"
          TargetType="local:DataRow"
          BasedOn="{StaticResource tableflowViewWindows7DataRowStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:ColumnManagerRow}"
          TargetType="local:ColumnManagerRow"
          BasedOn="{StaticResource tableflowViewWindows7ColumnManagerRowStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:Cell}"
          TargetType="local:Cell"
          BasedOn="{StaticResource tableflowViewWindows7CellStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:DataCell}"
          TargetType="local:DataCell"
          BasedOn="{StaticResource tableflowViewWindows7DataCellStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:ColumnManagerCell}"
          TargetType="local:ColumnManagerCell"
          BasedOn="{StaticResource tableflowViewWindows7ColumnManagerCellStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupByControl}"
          TargetType="local:GroupByControl"
          BasedOn="{StaticResource tableflowViewWindows7GroupByControlStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupByItem}"
          TargetType="local:GroupByItem"
          BasedOn="{StaticResource tableflowViewWindows7GroupByItemStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupHeaderControl}"
          TargetType="local:GroupHeaderControl"
          BasedOn="{StaticResource tableflowViewWindows7GroupHeaderControlStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupLevelIndicator}"
          TargetType="local:GroupLevelIndicator"
          BasedOn="{StaticResource tableflowViewWindows7GroupLevelIndicatorStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:DetailIndicator}"
          TargetType="local:DetailIndicator"
          BasedOn="{StaticResource tableflowViewWindows7DetailIndicatorStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupLevelIndicatorPane}"
          TargetType="local:GroupLevelIndicatorPane"
          BasedOn="{StaticResource tableflowViewWindows7GroupLevelIndicatorPaneStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:HierarchicalGroupLevelIndicatorPane}"
          TargetType="local:HierarchicalGroupLevelIndicatorPane"
          BasedOn="{StaticResource tableflowViewWindows7HierarchicalGroupLevelIndicatorPaneStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:ScrollTip}"
          TargetType="local:ScrollTip"
          BasedOn="{StaticResource tableflowViewWindows7ScrollTipStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:HierarchicalGroupByControl}"
          TargetType="local:HierarchicalGroupByControl"
          BasedOn="{StaticResource tableflowViewWindows7HierarchicalGroupByControlStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:HierarchicalGroupByControlNode}"
          TargetType="local:HierarchicalGroupByControlNode"
          BasedOn="{StaticResource tableflowViewWindows7HierarchicalGroupByControlNodeStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:HierarchicalGroupByItem}"
          TargetType="local:HierarchicalGroupByItem"
          BasedOn="{StaticResource tableflowViewWindows7HierarchicalGroupByItemStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupNavigationButton}"
          TargetType="{x:Type local:GroupNavigationButton}"
          BasedOn="{StaticResource tableflowViewWindows7GroupNavigationButtonStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupNavigationControl}"
          TargetType="{x:Type local:GroupNavigationControl}"
          BasedOn="{StaticResource tableflowViewWindows7GroupNavigationControlStyle}" />

   <Style x:Key="{markup:ThemeKey TargetViewType=views:TableflowView, ThemeType=views:Windows7Theme, TargetElementType=local:GroupNavigationControlItem}"
          TargetType="{x:Type local:GroupNavigationControlItem}"
          BasedOn="{StaticResource tableflowViewWindows7GroupNavigationControlItemStyle}" />

</ResourceDictionary>
